
	Tesla.fn.getActionName = function(action) {
		if (action.indexOf(".") < 0)
			return action;
		
		return action.substr(action.lastIndexOf(".") + 1);
	};

	Tesla.fn.getAction = function(action) {
		var _def = $.Deferred();
		
		require.async(this.resolveScriptUrl(action), function(controller) {
			_def.resolve(controller);
		});
		
		return _def.promise();
	};
	
	Tesla.fn.getServicePath = function(service) {
		return this.SERVICE_PREFIX + service;
	};

	Tesla.fn.resolveScriptUrl = function(action) {
		return this.BASE_PATH + this.TMPL_PATH
				+ action.substring(0, action.lastIndexOf(".")).replace(/\./g, "/")
				+ "/controller.js";
	};
	
	/**
	 * @param str ?param1=1&param2=2类似这种格式的字符串，如果不传默认为location。search
	 * @description 该方法将传入的search字符串转换为对象，暂时不支持数组参数的解析，存在相同名字的参数会覆盖
	 * @return param 
	 */
	Tesla.fn.resolveSearch = function(str) {
		var arr,
			param = {};
		
		if (!str) {
			str = location.search;
		}
		
		str = str ? decodeURI(str).substr(1) : "";
		arr = str.split("&");
		
		for (var i = 0, item; (item = arr[i]) != null; i++) {
			var tmp = item.split("=");
			param[tmp[0]] = tmp[1];
		}
		
		return param;
	};
	
	Tesla.fn.getEvent = getEvent;